<?php

namespace app\model;

use think\Model;

class UserModel  extends Model
{
    public $name = 'user';

    public static function getUserInfo($map=[]){
        return self::where($map)->find();
    }

    public static function setInsert($data=[]){
        $data['create_time']=date('Y-m-d H:i:s');
        $data['update_time']=date('Y-m-d H:i:s');
        $data['last_login_time']=date('Y-m-d H:i:s');
        return self::insertGetId($data);
    }

    public static function setUpdate($map=[],$data=[]){
        $data['update_time']=date('Y-m-d H:i:s');
        $data['last_login_time']=date('Y-m-d H:i:s');
        return self::where($map)->update($data);
    }
}